﻿@model Model.INVENTORY

@{
    ViewBag.Title = "Create";
    Layout = "~/Views/Shared/_Layout.cshtml";
}


@using (Html.BeginForm())
{
    @Html.AntiForgeryToken()
    <div class="box box-primary">
        <div class="box-header with-border">
            <h4>Tworzenie nowej inwentaryzacji</h4>
            <hr />
            @Html.ValidationSummary(true, "", new { @class = "text-danger" })
            <div class="form-group">
                <label>Nazwa Inwentaryzacji:</label>
                @Html.EditorFor(model => model.NAME, new { htmlAttributes = new { @class = "form-control", @placeholder = "Wpisz nazwę" } })
            </div>

            <div class="form-group">
                <label>Zakład:</label>
                @Html.EditorFor(model => model.PLANT, new { htmlAttributes = new { @class = "form-control", @placeholder = "Wpisz nazwę zakładu" } })
            </div>

            <div class="form-group">
                <label>Zakres daty od:</label>
                @Html.EditorFor(model => model.PERIOD_FROM, new { htmlAttributes = new { @class = "form-control", @id = "data1", @placeholder = "Wybierz datę" } })
            </div>

            <div class="form-group">
                <label>Zakres daty do:</label>
                @Html.EditorFor(model => model.PERIOD_TO, new { htmlAttributes = new { @class = "form-control", @id = "data2", @placeholder = "Wybierz datę" } })
            </div>

            <input type="submit" value="Zapisz" class="btn btn-primary" />
            @Html.ActionLink("Powrót", "Index", new { id = 1 }, new { @class = "btn btn-primary" })
        </div>
    </div>
}

<script>
    $('#data1').datepicker({
        dateFormat: 'dd-mm-yy',
        minDate: '+5d',
        changeMonth: true,
        changeYear: true,
        altField: "#idTourDateDetailsHidden",
        altFormat: "yy-mm-dd"
    });
    $('#data2').datepicker({
        dateFormat: 'dd-mm-yy',
        minDate: '+5d',
        changeMonth: true,
        changeYear: true,
        altField: "#idTourDateDetailsHidden",
        altFormat: "yy-mm-dd"
    });
</script>
